#ifndef __M_TEXT_H__
#define __M_TEXT_H__

typedef struct TextListEntry
{
    struct TextListEntry *next;
    struct TextListEntry *previous;
    char *text;
} TextListEntry;

typedef struct
{
    TextListEntry *head;
    TextListEntry *tail;
    int length;
} TextList;

TextListEntry *textListGetEntryByNumber(TextList *list, int n);
void textListAddEntry(TextList *list, TextListEntry *entry);
void textListAddEntryFromString(TextList *list, const char *string);
void textListEmpty(TextList *list);

void textViewSetAutoScroll(int scroll);

TextList *getDefaultTextList();
void drawTextView();
int ctrlTextView();
int loopTextView();
int initTextView();
int finishTextView();

int initTextViewThread();
int waitTextViewThreadEnd();
int finishTextViewThread();

#endif